Platform Explorer / Nuxeo Platform 2023.22

Extension point templates

Documentation

This extension point can be used to define templates for notifications.

By default inside the template files those expressions are available to use:

${docId} - the UID of the document that produced the notification

${author} - the user name of who or what produced the event

${principalAuthor} - the same as ${author}

${principalAuthor.firstName} - the first name of ${principalAuthor} if defined for the corresponding user

${principalAuthor.lastName} - the family name of ${principalAuthor} if defined for the corresponding user

${dateTime) - date and time when it happened - must be formatted according to the freemaker rules

${docUrl} - For now it displays the path to follow to get to the document that was the source of the event

${docTitle} - displays the title of the document that produced the notification

${newDocUrl} - this can display the path of the document modified/created inside the document that produced the notification. This newDoc is the child of the producer document.

${newDocTitle} - the same that ${newDocUrl}, but displays the title.

${newDocId} - the same that ${newDocUrl}, but displays the UID.

If you need to add some more variables into your templates, just put the data you need to display in the notification in the eventInfo map of the JMS message that is sent to queue topic/NXPMessages.

The same goes for subject but in this case there is no need to define a template. Just put the string that you need to have as subject and if it contains dynamic elements ${XXX}, they will be rendered just like it happens in the body.

For example :

When creating the message : mesage.getEventInfo().put("docSize", sizeOfDocument);

In your template file : The document has ${docSize}KB.

Contribution Descriptors

  • Class: org.nuxeo.ecm.platform.ec.notification.service.TemplateDescriptor

Existing Contributions

Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.

  • nuxeo-coldstorage-2023.3.6.jar /OSGI-INF/coldstorage-events-contrib.xml
    <extension point="templates" target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService">
        <template name="coldStorageContentAvailable" src="templates/coldStorageContentAvailable.ftl"/>
        <template name="coldStorageContentRestored" src="templates/coldStorageContentRestored.ftl"/>
      </extension>
  • nuxeo-easyshare-core-2023.22.13.jar /OSGI-INF/extensions.xml
    <extension point="templates" target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService">
        <template name="easyShareDownload" src="templates/easyShareDownload.ftl"/>
        <template name="easyShareExpired" src="templates/easyShareExpired.ftl"/>
        <template name="easyShareDownloadSubject" src="templates/easyShareDownloadSubject.ftl"/>
        <template name="easyShareExpiredSubject" src="templates/easyShareExpiredSubject.ftl"/>
      </extension>
  • nuxeo-permissions-2023.22.13.jar /OSGI-INF/notifications-contrib.xml
    <extension point="templates" target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService">
    
        <template name="aceGranted" src="templates/aceGranted.ftl"/>
    
      </extension>
  • nuxeo-platform-comment-2023.22.13.jar /OSGI-INF/comment-notification-contrib.xml
    <extension point="templates" target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService">
        <template name="baseComment" src="templates/baseComment.ftl"/>
        <template name="commentAdded" src="templates/commentAdded.ftl"/>
        <template name="commentUpdated" src="templates/commentUpdated.ftl"/>
      </extension>
  • nuxeo-platform-comment-workflow-2023.22.13.jar /OSGI-INF/notification-contrib.xml
    <extension point="templates" target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService">
    
        <template name="comment" src="templates/comment.ftl"/>
    
      </extension>
  • nuxeo-platform-notification-2023.22.13.jar /OSGI-INF/notification-contrib.xml
    <extension point="templates" target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService">
    
        <template name="subscriptionsUpdated" src="templates/subscriptionsUpdated.ftl"/>
        <template name="modif" src="templates/modif.ftl"/>
        <template name="publish" src="templates/publish.ftl"/>
        <template name="docPublishingSubject" src="templates/docPublishingSubject.ftl"/>
        <template name="auto" src="templates/auto.ftl"/>
        <template name="workflow" src="templates/workflow.ftl"/>
        <template name="aprobationWorkflowStarted" src="templates/appReviewStarted.ftl"/>
        <template name="emailDocument" src="templates/emailDocument.ftl"/>
        <template name="workflowTaskAssigned" src="templates/workflowTaskAssigned.ftl"/>
        <template name="workflowTaskDelegated" src="templates/workflowTaskDelegated.ftl"/>
        <template name="defaultNotifTemplate" src="templates/defaultNotifTemplate.ftl"/>
    
      </extension>